<?php
$title = $model->isNewRecord ? '创建' : '更新';
$this->breadcrumbs = array(
    '角色管理' => array('/admin/role'),
    $title,
);
?>
<div class="row">
    <div class="col-md-6">
        <blockquote><b>角色信息</b></blockquote>
        <?php
        $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
            'id' => 'CreateForm',
            'type' => 'horizontal',
            'enableAjaxValidation' => false,
            'enableClientValidation' => true,
            'clientOptions' => array(
                'validateOnSubmit' => true,
            ),
        ));
        echo $form->textFieldRow($model, 'name');
        echo $form->textAreaRow($model, 'remark', array('rows' => 8,));
        ?>
    </div>
    <div class="col-md-3">
        <blockquote><b>角色权限</b></blockquote>
        <?php
        echo Permission::getPermissionTree('Role[perms][]', 'Role_perms', $model->getPermitArray());
        ?>
        <blockquote><b>角色API授权</b></blockquote>
        <?php
        echo Auth::getAuthTree('Role[auths][]', 'Role_auths', $model->getAuthArray());
        ?>
    </div>
    <div class="col-md-3">
        <?php
        echo Menu::getMenuTree('Role[menus][]', 'Role_menus', $model->getMenuArray());
        ?>
    </div>
    <div class="col-md-3">
        <blockquote><b>角色App_API授权</b></blockquote>
        <?php
        echo Auth::getAuthTree('Role[auths][]', 'Role_auths', $model->getAuthArray(Auth::TYPE_APP),array(),Auth::TYPE_APP);
        ?>
    </div>
    <div class="col-md-12">
        <hr>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => '保存',
            'htmlOptions' => array('class' => 'submit', 'style' => 'width:140px;margin:15px 400px;'),
        ));
        $this->endWidget();
        ?>
    </div>
</div>
